﻿using System;
using System.Collections.Generic;

namespace eCommerce.db.DataRespository
{
    public class ProductEntity
    {
        public int ProductId { get; set; }
        public int CategoryId { get; set; }
        public int Status { get; set; }
        public int SizeType { get; set; }        
        public string Code { get; set; }
        public string Name { get; set; }
        public string ParentName { get; set; }
        public string Description { get; set; }
        public string ImagePath { get; set; }        
        public string Content { get; set; }
        public decimal UnitPrice { get; set; }
        public decimal SpecialPrice { get; set; }
        public DateTime CreatedOn { get; set; }
        public string CreatedBy { get; set; }
        public DateTime EditedOn { get; set; }
        public string EditedBy { get; set; }
        public long View { get; set; }
        public string Url { get; set; }        

        public int ItemIndex { get; set; }
        public int ImageCount { get; set; }
        public string CategoryName { get; set; }
        public string UrlCategory { get; set; }
        public string FormatUnitPrice { get; set; }
        public string FormatSpecialPrice { get; set; }        
        public string IsLast { get; set; }
        public string IconStatus { get; set; }
        public string UrlProduct { get; set; }
        public string Sizes { get; set; }

        public List<PropertyValueEntity> LstPropertyValue { get; set; }
        public List<SizeEntity> LstSize { get; set; }

        private readonly Dictionary<string, object> _extendedProperties = new Dictionary<string, object>();
        public object this[string propertyName]
        {
            get
            {
                return (_extendedProperties.ContainsKey(propertyName) ? _extendedProperties[propertyName] : null);
            }
            set
            {
                if (_extendedProperties.ContainsKey(propertyName))
                {
                    _extendedProperties[propertyName] = value;
                }
                else
                {
                    _extendedProperties.Add(propertyName, value);
                }
            }
        }
    }
}
